package scanner.user.controller;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class PwdExamine extends ActionSupport {

	int length;
	String pwdLenInfo;
	String pwdNumInfo;
	String pwdErrInfo;
	public String execute(String q) throws Exception
	{
		if(q==null)
		{
			System.out.print("q为空");
		}
		System.out.print(q);
		length = q.length();
		if(length < 6)
		{
			pwdLenInfo = "密码长度太短   ";
		}
		for(int i = 0;i < length;i++)
		{
			if(q.charAt(i) > '0' && q.charAt(i) < '9')
			{
				pwdNumInfo = "密码请不要设置为纯数字！";
			}
		}
		pwdErrInfo = pwdLenInfo+pwdNumInfo;
		System.out.print(pwdErrInfo);
		ActionContext.getContext().getSession().put("pwdErrInfo",pwdErrInfo);
		return "success";
	}
		
}

